home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0191.ZIP
/
EP.INC
< prev
next >
Wrap
Text File
|
1985-09-29
|
15KB
|
424 lines
{-------------------------------------------------------------------------}
{ EP.INC Set Epson Printer }
{-------------------------------------------------------------------------}
{ }
{ Copyright 1985 }
{ by Karson W. Morrison }
{ RD 1, Box 531 }
{ Ringoes, NJ 08551 }
{ and }
{ Lynn A. Canning }
{ 9107 Grandview Dr. }
{ Overland Park, Ks 66212 }
{ This program was placed in the public domain by the authors. }
{ It may be used and copied as desired, but it cannot be sold. }
{-------------------------------------------------------------------------}
const
X0 = 05;
Y0 = 1;
X1 = 75;
Y1 = 25;
cons0 = ' 0) Reset (Power up state) ';
cons1 = ' 1) Pica ';
cons2 = ' 2) Elite ';
cons3 = ' 3) Italic ';
cons4 = ' 4) Enlarged ';
cons5 = ' 5) Emphasized ';
cons6 = ' 6) Condensed ';
cons7 = ' 7) Subscript ';
cons8 = ' 8) Double Strike ';
cons9 = ' 9) Proportional ';
consA = ' A) 1/6 inch line spacing';
consB = ' B) 1/8 inch line spacing';
consC = ' C) 7/72 inch line spacing';
consD = ' D) n/216 inch line spacing';
consE = ' E) Double spacing ';
consF = ' F) Skip Over Perforation ';
consG = ' G) Set Left Margin ';
consH = ' H) Printer Line Advance ';
consI = ' I) Printer Page Advance ';
consJ = ' J) Print a Test Pattern ';
consK = ' K) Small Printed Listing ';
head1 = ' TEST OPTIONS ';
col2spce = ' ';
SWON = ' ON';
SWOFF = ' ';
var
i,Num,t,result : Integer;
Ch : Char;
SW : Array[1..17] OF String[3];
cntl,numin : string[3];
{ Internal Routines Begin Here ****************************** }
procedure Window1;
begin
GoToXY(1,1);
ClrScr;
TextColor(black);
Writeln(' Epson Printer Setup (C) Copyright 1985 ');
Writeln(' Version 4.00 by Karson W. Morrison and Lynn A. Canning');
Writeln;
TextColor(red);
Writeln(' CHARACTER OPTIONS LINE SPACING OPTIONS');
Writeln;
Writeln(sw[1]+cons1+sw[10]+consA);
Writeln(sw[2]+cons2+sw[11]+consB);
Writeln(sw[3]+cons3+sw[12]+consC);
Writeln(sw[4],cons4,sw[13]:3,consD);
Writeln(sw[5]+cons5+sw[14]+consE);
Writeln(sw[6]+cons6+sw[15]+consF);
Writeln(sw[7]+cons7,sw[16]:3,consG);
Writeln(sw[8]+cons8+col2spce);
Writeln(sw[9]+cons9+head1);
Writeln;
Writeln(cons0+consH);
Writeln(' '+consI);
Writeln(sw[17]+consK+consJ);
Writeln;
Writeln(' X) Exit Program ');
GoToXY(18,22);
Write(' Option Wanted ');
TextColor(blue);
GoToXY(1,6);
Writeln(sw[1]);
GoToXy(37,6);
Writeln(sw[10]);
end;
PROCEDURE Window3;
BEGIN
MkWin(1,6,80,20,2,2,0);
GoToXY(1,1);
ClrScr;
Writeln;
Writeln(' Set n/216 Line Spacing');
Writeln;
Writeln(' Examples');
Writeln;
Writeln(' Normal spacing of 6 lines per inch would be 36/216');
Writeln(' 7/72 is approxmiately 10 lines per inch or 21/216');
Writeln(' The Double Space option used in this program is 54/216');
Writeln;
Writeln(' The number selected must be between 0 and 255');
Writeln;
repeat
GoToXY(8,12);
Write(' Enter Selected Number followed by Carriage Return ');
GoToXY(59,12);
num := 256;
Read(Numin);
Val(numin,num,result);
if (num < 1) or (num > 255) then
begin
MkWin(5,11,75,15,2,6,0);
GotoXY(1,1);
ClrScr;
Writeln;
Writeln(' The number must be between 1 and 255');
TimeDelay(3);
RmWin;
end;
until (num in [1..255]);
RmWin;
end;
PROCEDURE Window5;
BEGIN
MkWin(1,6,80,20,2,2,0);
GoToXY(1,1);
ClrScr;
Writeln;
Writeln(' Set Left Margin');
Writeln;
Writeln(' The maximum value that can be selected is determined by');
Writeln(' the current print mode. Illegal settings are ignored.');
Writeln;
Writeln(' In Pica mode the number selected must be between 0 and 134');
Writeln(' In Condenced mode the number selected must be between 0 and 229');
Writeln(' In Elite mode the number selected must be between 0 and 160');
Writeln;
Writeln(' The number selected must be between 0 and 229');
Writeln;
repeat
GoToXY(8,12);
Write(' Enter Selected Number followed by Carriage Return ');
GoToXY(59,12);
num := 256;
Read(Numin);
Val(numin,num,result);
if (num < 1) or (num > 229) then
begin
MkWin(5,11,75,15,2,6,0);
GotoXY(1,1);
ClrScr;
Writeln;
Writeln(' The number must be between 1 and 229');
TimeDelay(3);
RmWin;
end;
until (num in [1..229]);
RmWin;
end;
procedure WriteAlpha;
begin
textcolor(blue);
gotoXY(1,6);
Writeln(sw[1]);
Writeln(sw[2]);
Writeln(sw[3]);
Writeln(sw[4]);
Writeln(sw[5]);
Writeln(sw[6]);
Writeln(sw[7]);
Writeln(sw[8]);
Writeln(sw[9]);
gotoXY(37,6);
Writeln(sw[10]);
gotoXY(37,7);
Writeln(sw[11]);
gotoXY(37,8);
Writeln(sw[12]);
gotoXY(37,9);
Writeln(sw[13]:3);
gotoXY(37,10);
Writeln(sw[14]);
gotoXY(37,11);
Writeln(sw[15]);
gotoXY(37,12);
Writeln(sw[16]:3);
gotoXY(1,18);
Writeln(sw[17]);
end;
procedure CheckInput;
begin
TextColor(blue);
Read(Kbd,Ch);
Ch := UpCase(Ch);
Write(Ch);
if Ch='0' then
begin
FOR t := 1 TO 17 DO
sw[t] := SWOFF;
sw[1] := SWON;
sw[10] := SWON;
Write(Lst,#$1B#$40); { function0 }
MkWin(1,10,80,15,2,6,0);
ClrScr;
Writeln;
Writeln(' Reset printer option causes the top of form to be where the printer is now');
Writeln(' Remember to line up the paper in your printer');
For t := 1 TO 4 DO begin
Write(Lst,^G^G);
Delay(200);
end;
TimeDelay(5);
RmWin;
end;
if Ch='1' then begin Write(Lst,#$1B#$50); { function1 }
sw[1] := SWON;
sw[2] := SWOFF;
end;
if Ch='2' then begin Write(Lst,#$1B#$4D); { function2 }
sw[1] := SWOFF;
sw[2] := SWON;
end;
if Ch='3' then { function 3 }
if (sw[3] = SWOFF) then begin
Write(Lst,#$1B#$34);
sw[3] := SWON;
end
else begin
Write(Lst,#$1B#$35);
sw[3] := SWOFF;
end;
if Ch='4' then { function 4 }
if (sw[4] = SWOFF) then begin
Write(Lst,#$1B#$57#$31);
sw[4] := SWON;
end
else begin
Write(Lst,#$1B#$57#$30);
sw[4] := SWOFF;
end;
if Ch='5' then { function 5 }
if (sw[5] = SWOFF) then begin
Write(Lst,#$1B#$45);
sw[5] := SWON;
end
else begin
Write(Lst,#$1B#$46);
sw[5] := SWOFF;
end;
if Ch='6' then
if (sw[6] = SWOFF) then begin
Write(Lst,#$0F); { function6 }
sw[6] := SWON;
end
else begin
Write(Lst,#$12);
sw[6] := SWOFF;
end;
if Ch='7' then { function 7 }
if (sw[7] = SWOFF) then begin
Write(Lst,#$1B#$53#$31);
sw[7] := SWON;
end
else begin
Write(Lst,#$1B#$54);
sw[7] := SWOFF;
end;
if Ch='8' then
if (sw[8] = SWOFF) then begin
Write(Lst,#$1B#$47); { function8 }
sw[8] := SWON;
end
else begin
Write(Lst,#$1B#$48);
sw[8] := SWOFF;
end;
if Ch='9' then
if (sw[9] = SWOFF) then begin
Write(Lst,#$1B#$70#$31); { function9 }
sw[9] := SWON;
end
else begin
Write(Lst,#$1B#$70#$30);
sw[9] := SWOFF;
end;
if Ch='A' then begin
Write(Lst,#$1B#$32); { functionA }
FOR t := 10 TO 14 DO
sw[t] := SWOFF;
sw[10] := SWON;
end;
if Ch='B' then begin
Write(Lst,#$1B#$30); { functionB }
FOR t := 10 TO 14 DO
sw[t] := SWOFF;
sw[11] := SWON;
end;
if Ch='C' then begin
Write(Lst,#$1B#$31); { functionC }
FOR t := 10 TO 14 DO
sw[t] := SWOFF;
sw[12] := SWON;
end;
if Ch='D' then begin { functionD }
window3;
FOR t := 10 to 14 DO
sw[t] := SWOFF;
sw[13] := numin;
Write(Lst,Chr(27)+Chr(51)+Chr(Num));
end;
if Ch='E' then begin
Write(Lst,#$1B#$41#$18); { functionE }
FOR t := 10 TO 14 DO
sw[t] := SWOFF;
sw[14] := SWON;
end;
if Ch='F' then
if (sw[15] = SWOFF) then begin
Write(Lst,#$1B#$4E#$06); { functionF }
sw[15] := SWON;
end
else begin
Write(Lst,#$1B#$4F);
sw[15] := SWOFF;
end;
if Ch='G' then begin { functionG }
window5;
textcolor(blue);
sw[16] := numin;
Write(Lst,Chr(27)+Chr(108)+Chr(Num));
end;
if Ch='K' then
if (sw[17] = SWOFF) then begin
sw[17] := SWON;
sw[6] := SWON;
sw[7] := SWON;
sw[15] := SWON;
sw[16] := ' 12';
for t := 10 TO 14 DO
sw[t] := SWOFF;
sw[13] := ' 15';
Write(Lst,#$0F); {condensed on}
Write(Lst,#$1B#$53#$31); {subscript on}
Write(Lst,Chr(27)+Chr(51)+Chr(15)); {15/216 line spacing}
Write(Lst,#$1B#$4E#$06); {skip perforation}
Write(Lst,Chr(27)+Chr(108)+Chr(12)); {indent 12 spaces}
end
else begin
sw[17] := SWOFF;
sw[6] := SWOFF;
sw[7] := SWOFF;
sw[15] := SWOFF;
sw[16] := SWOFF;
sw[13] := SWOFF;
for t := 10 TO 14 DO
sw[t] := SWOFF;
sw[10] := SWON;
Write(Lst,#$12); {condensed off}
Write(Lst,#$1B#$54); {subscript off}
Write(Lst,#$1B#$32); {1/6 line spacing}
Write(Lst,#$1B#$4F); {skip perforation off}
Write(Lst,Chr(27)+Chr(108)+Chr(0)); {indent 0 spaces}
end;
WriteAlpha;
if Ch='H' then Write(Lst,#$0A); { functionH }
if Ch='I' then Write(Lst,#$0C); { functionI }
if Ch='J' then { functionJ }
begin
Write(Lst,'OPTIONS--> ');
if (sw[1] = SWON) then Write(Lst,'-Pica ');
if (sw[2] = SWON) then Write(Lst,'-Elite ');
if (sw[3] = SWON) then Write(Lst,'-Italic ');
if (sw[4] = SWON) then Write(Lst,'-Expanded ');
if (sw[5] = SWON) then Write(Lst,'-Emphasized ');
if (sw[6] = SWON) then Write(Lst,'-Compressed ');
if (sw[7] = SWON) then Write(Lst,'-Subscript ');
if (sw[8] = SWON) then Write(Lst,'-Double-strike ');
if (sw[9] = SWON) then Write(Lst,'-Proportional ');
if (sw[10] = SWON) then Write(Lst,'-1/6" ');
if (sw[11] = SWON) then Write(Lst,'-1/8" ');
if (sw[12] = SWON) then Write(Lst,'-7/72" ');
if NOT (sw[13] = SWOFF) then Write(Lst,'-',sw[13],'/216 ');
if (sw[14] = SWON) then Write(Lst,'-Double-space ');
if (sw[15] = SWON) then Write(Lst,'-Skip-perf ');
if NOT (sw[16] = SWOFF) then Write(Lst,'-Left Margin=',sw[16]);
Writeln(Lst,' ');
Writeln(Lst,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890');
Writeln(Lst,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890');
Writeln(Lst,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890');
Writeln(Lst,' ');
end;
end;
{ Main Program Begins Here ********************************** }
BEGIN
MkWin(x0,y0,x1,y1,2,4,3);
ClrScr;
FOR t := 1 TO 17 DO
sw[t] := SWOFF;
sw[1] := SWON;
sw[10] := SWON;
Write(Lst,#$1B#$40); {reset Printer}
Window1;
repeat
GoToXY(36,22);
CheckInput;
until UpCase(Ch) = 'X';
ClrScr;
Window(1,1,80,25);
GotoXY(1,24);
TextColor(0);
TextBackground(15);
RmWin;
end;